function customTinyMCE_init(sName)
{
    if (!sName)
    {
        return false;
    }

    tinyMCE.sTextareaName = sName;

	tinyMCE.init({
		mode : 'exact',
		elements : sName,
		theme : "advanced",
		theme_advanced_buttons1 : "bold,italic,underline,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,separator,cut,copy,paste,separator,anchor,link,unlink",
		theme_advanced_buttons2 : "fontselect,fontsizeselect,separator,forecolor,image,code",
		theme_advanced_buttons3 : "",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "center",
        theme_advanced_statusbar_location : "bottom",
        cleanup : false,
        theme_advanced_resizing : true,
        theme_advanced_resize_horizontal : true,
        theme_advanced_more_colors : false,
		convert_urls : false,
		relative_urls : true,
		language : sLangVar
	});
}

customTinyMCE_init('maintext');